package com.info.zhiduoduo.core.dto.alipay;

import com.info.zhiduoduo.repository.entity.order.TradeRecord;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class AlipayTransferQueryFormBean {
    private int paymentMerchant;
    //业务参考号
    private String tradeNo;

    public static AlipayTransferQueryFormBean of(TradeRecord tradeRecord) {
        return new AlipayTransferQueryFormBean()
                .setPaymentMerchant(tradeRecord.getMerchantid())
                .setTradeNo(tradeRecord.getTradeno());
    }

    public static AlipayTransferQueryFormBean of(Integer merchantId, String partnerOrderNo) {
        return new AlipayTransferQueryFormBean()
                .setPaymentMerchant(merchantId)
                .setTradeNo(partnerOrderNo);
    }

}
